package com.kk.init;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 7.bean 名字感知.
 *
 * <p>
 * .
 *
 * @author little_lunatic
 * @date 2023-08-10
 */
@Slf4j
@Component("nihaoAware")
public class TestBeanNameAware implements BeanNameAware {
    @Override
    public void setBeanName(String s) {
        log.info("7.bean 名字感知. BeanName = {}", s);
    }

    @PostConstruct
    public void init(){
        setBeanName("不响丸辣");
        log.info("不响丸辣");
    }
}
